package com.test.graphsqltest.graphql.resolver;

import com.test.graphsqltest.beans.Item;
import com.test.graphsqltest.beans.ItemList;
import com.test.graphsqltest.beans.Param;
import com.test.graphsqltest.service.IItemService;
import graphql.kickstart.tools.GraphQLMutationResolver;
import graphql.kickstart.tools.GraphQLQueryResolver;

/**
 * @Description: TODO
 * @author: wangming
 * @date: 2021年08月15日 15:40
 */
public class ItemResolver implements GraphQLQueryResolver, GraphQLMutationResolver {
    private IItemService itemService;

    public ItemResolver(IItemService iItemService){
        this.itemService= iItemService;
    }

    /**
    * @Description: TODO
    * @author: wangming
    * @date: 这个表示为对应graphql里的item.graphqls的
    
    * @Return: 
    */
    public ItemList queryItemList(){
        return this.itemService.queryItemList();
    }

    public Item queryById(Long id){
        return this.itemService.queryById(id);
    }

    public Item updateName(Param param){
        return this.itemService.updateName(param);
    }

    public Item deleteItem(Long id){
        return this.itemService.deleteItem(id);
    }

}
